const KoaRouter = require('@koa/router');


const { verifyUser, handlePassword } = require('../middleware/user.middleware');
const userController = require('../controller/user.controller');
// 1. 创建路由对象
const userRouter = new KoaRouter({ prefix: '/users' })
// 2. 定义路径映射
// 2.1 用户注册接口 
// 密码加密🔐
userRouter.post('/', verifyUser, handlePassword, userController.create);

// 2.2 为用户提供头像查看
userRouter.get('/avatar/:userId', userController.showAvatarImage)
// 3. 导出
module.exports = userRouter